package sketch.generator;

import sketch.GenTest;
import sketch.MethodChoice;
import sketch.OracleChoice;
import sketch.ValueChoice;
import sketch.generator.ValueGenerator;
import sketch.subject.TreeMap;


public class ExampleSketchTest extends GenTest {

	@Override
	public void scratchTest() {
		/**
		 * Sketch begins
		 * */
		TreeMap treemap = new TreeMap();
		treemap.put(10);
		treemap.put(2);
		treemap.put(3);
		
		ValueGenerator<Integer> intPool = ValueChoice.getIntRange(1, 2);
		MethodChoice.permute(treemap, "put(int)", intPool);
		
		ValueGenerator<?> containArgs = ValueChoice.getIntRange(2, 4);//ValueChoice.randomChoose(1, intPool);
		OracleChoice.observeMethodOutput(treemap, "containsKey(int)", containArgs, false);
		
		treemap.remove(3);
		treemap.remove(2);
		treemap.remove(1);
		treemap.remove(20);
		
		MethodChoice.choose(treemap.toString(), "print()");
	}

	@Override
	public String scratchTestPath() {
		//System.out.println("call this");
		return "/scratch/eclipseworkspace/SketchSeq/tests/sketch/generator/ExampleSketchTest.java";
	}

	@Override
	public Class<?>[] testedClasses() {
		return new Class<?>[]{TreeMap.class};
	}

	@Override
	public String testOutputPath() {
		return ".";
	}

	@Override
	public String testClassName() {
		return "TreemapTest";
	}
	
}
